package controllers

import (
	"mygolang/models"

	beego "github.com/beego/beego/v2/server/web"
)

type DemoController struct {
	beego.Controller
}

// Echo ...
// @Title Echo
// @Description echo
// @Param  message  query  string  true  "the echo message"
// @Success 200 {object} models.EchoModel
// @router /echo [get]
func (c *DemoController) Echo() {
	message := c.Ctx.Request.URL.Query().Get("message")
	// message := c.GetString("message")
	data := &models.EchoModel{}
	data.Message = message
	c.Data["json"] = data
	c.ServeJSON()
}
